home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / bipl.zip / PROCS.ZIP / GENER.ICN < prev    next >
Text File  |  1992-09-28  |  1KB  |  57 lines

  1. ############################################################################
  2. #
  3. #    File:     gener.icn
  4. #
  5. #    Subject:  Procedures to generate miscellaneous sequences
  6. #
  7. #    Author:   Ralph E. Griswold
  8. #
  9. #    Date:     September 21, 1991
  10. #
  11. ###########################################################################
  12. #  
  13. #  These procedures generate sequences of results.
  14. #  
  15. #    days()        days of the week.
  16. #
  17. #       hex()        sequence of hexadecimal codes for numbers
  18. #            from 0 to 255
  19. #  
  20. #       label(s,i)    sequence of labels with prefix s starting at i
  21. #
  22. #    months()    months of the year
  23. #
  24. #    octal()        sequence of octal codes for numbers from 0 to 255
  25. #  
  26. #    star(s)        sequence consisting of the closure of s
  27. #            starting with the empty string and continuing
  28. #            in lexical order as given in s
  29. #  
  30. ############################################################################
  31.  
  32. procedure days()
  33.    suspend "Sunday" | "Monday" | "Tuesday" | "Wednesday" | "Thursday" |
  34.       "Friday" | "Saturday"
  35. end
  36.  
  37. procedure hex()
  38.    suspend !"0123456789abcdef" || !"0123456789abcdef"
  39. end
  40.  
  41. procedure label(s,i)
  42.    suspend s || (i | (i +:= |1))
  43. end
  44.  
  45. procedure months()
  46.    suspend "January" | "February" | "March" | "April" | "May" | "June" |
  47.       "July" | "August" | "September" | "October" | "November" | "December"
  48. end
  49.  
  50. procedure octal()
  51.    suspend (0 to 3) || (0 to 7) || (0 to 7)
  52. end
  53.  
  54. procedure star(s)
  55.    suspend "" | (star(s) || !s)
  56. end
  57.